package org.qqcui.designpattern.patterns.interpreter;

import java.util.Map;

/**
 * 减法表达式，将左右两边数据相减
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/7 11:05
 **/
public class SubExpression extends SymbolExpression {
    public SubExpression(Expression left, Expression right) {
        super(left, right);
    }

    @Override
    public int interpreter(Map<String, Integer> var) {
        return this.left.interpreter(var) - this.right.interpreter(var);
    }
}
